# -*- coding: utf-8 -*-
# @Time    : 2021/1/4 上午11:02
# @Author  : tgy


def find_subsequence(str):
    ...
    results = []
    result = []
    subsequence(tuple(str), 0, result, results)
    return results


def subsequence(chars, index, result, results):
    ...
    if index == len(chars):
        if len(result):
            results.append(''.join(result))
        return
    # 取index位置的char
    result.append(chars[index])
    subsequence(chars, index + 1, result, results)
    # 不取index位置的char
    # del result[-1]
    result.pop()
    subsequence(chars, index + 1, result, results)



if __name__ == '__main__':
    """
    子序列 abc ab a bc b c
    """
    results = find_subsequence('abc')
    print(results)
